//app.js
//const baseUrl = "https://wx.scoringchina.com/gplanett/";//
const baseUrlTest = "https://wx.scoringchina.com/aja/"; //  
const baseUrl = "https://mapp.scoringchina.com/interface/Xijiuopen/";
const fileUrl = "https://miniapp.scoringchina.com/fileinterface/";
const wssUrl = 'wss://wss.scoringchina.com/wss/';
const weburl = 'https://miniapp.scoringchina.com';
const refreshtime = 60 * 1000;
const CON_loop = "loop";
const clubID = 569;

App({

  onLaunch: function () {
   // this.openloading();
    this.updateminiapp();
    this.getPixradio(); //获取像素

    if(wx.getStorageSync('AD')){
       this.globalData.bannerAd = wx.getStorageSync('AD');
       console.log('AD', this.globalData.bannerAd);
    }
    var isautologin = wx.getStorageSync("isautologin");
    if (isautologin) {
      this.wxlogin(this);
    }

  },

  openloading(){
    wx.navigateTo({
      url: '/pages/loading/index',
    })
  },


  ///post的方式异步获取服务器数据
  requestdata(url, param, sucessfun, failfun, finnalfun,isjson) {
    var that = this;
    console.log("before-param");
    console.log(param);
    if(!isjson){
    var param = param;
    param.user_id = (this.globalData.userInfo.userID) ? this.globalData.userInfo.userID : 0;
    param.userID = (this.globalData.userInfo.userID) ? this.globalData.userInfo.userID : 0;
    param.playerID = (this.globalData.userInfo.player_id) ? this.globalData.userInfo.player_id : 0;
    param.openid = (this.globalData.userInfo.openid) ? this.globalData.userInfo.openid : 0;
    param.miniappid = this.globalData.appId;
    param.clubID = clubID;

   /* param.userID  =  3825;
    param.user_id =  3825;
    param.playerID = 50901;*/

    console.log("param");
    console.log(param);
    }
    else{
      param = JSON.stringify(param);
      console.log(param);
    }
    wx.request({
      url: url, //接口地址
      method: "POST",
      data: param,
      header: {
        "Content-Type": "application/x-www-form-urlencoded" //默认值
      },
      success: function (res) {
        console.log(res);
        sucessfun(res);
      },
      fail: function (res) {
        console.log(res);
        var datares;
        if (res.errMsg = "request:fail") {
          datares = {
            error: that.langpagcke.errormsg[that.globalData.lang]
          }
        } else {
          datares = {
            error: res.errMsg
          };
        }
        if (failfun) {
          failfun(datares);
        } else {
          wx.showToast({
            title: datares.error,
            icon: 'none',
            duration: 3000,
          })
        }
      },
      complete() {
        if (finnalfun) {
          finnalfun();
        }
      }
    })
  },
  getPixradio: function () {
    var fullheight = wx.getSystemInfoSync().windowHeight;
    var windowswidth = wx.getSystemInfoSync().windowWidth;
    var pixelRatio = windowswidth / 750; // wx.getSystemInfoSync().pixelRatio;
    console.log("pixelRatio");
    console.log(pixelRatio);
    this.globalData.pixelRatio = pixelRatio;
    this.globalData.fullheight = fullheight;
    this.globalData.fullwidth = windowswidth;
  },

  getlogoes(succuse, matchid) {
    var that = this;
    var param = {
      match_id: (matchid) ? matchid : 0,
      type_id: 2,
    };
    if (!matchid) {
      param.type_id = 1;
    }
    console.log("getsponorlogo");
    console.log(param);
    this.requestdata(this.globalData.interfacegetlogoes, param, function (res) {
      if (res.data.errocode = "ok") {

        if (succuse) {
          succuse(res);
        }
        console.log("that.globalData.logoes");
        console.log(that.globalData.logoes);
        var pages = getCurrentPages() //获取加载的页面
        var currentPage = pages[pages.length - 1]; //获取当前页面的对象
        if (currentPage && currentPage.refreshBg) {
          currentPage.refreshBg();
        }
      }
    })
  },

  ///设置语音版本
  setlang: function () {
    wx.setStorageSync('lang', this.globalData.lang);
    var pages = getCurrentPages() //获取加载的页面
    var currentPage = pages[pages.length - 1]; //获取当前页面的对象
    if (currentPage && currentPage.changeLang) {
      currentPage.changeLang();
    }
  },

  ///获取相应的语音的标题
  getTitleBylang: function () {
    console.log("this.langpagcke.apptitle[this.globalData.lang]");
    console.log(this.langpagcke.apptitle[this.globalData.lang]);
    return this.langpagcke.apptitle[this.globalData.lang];
  },

  setNavigationBarTitle: function () {
    wx.setNavigationBarTitle({
      title: this.getTitleBylang(),
    })
  },

  updateminiapp() {
    var version = this.langpagcke.version;
    var lang = this.globalData.lang;
    if (wx.canIUse('getUpdateManager')) {
      const updateManager = wx.getUpdateManager()
      updateManager.onCheckForUpdate(function (res) {
        console.log('onCheckForUpdate====', res)
        // 请求完新版本信息的回调
        if (res.hasUpdate) {
          console.log('res.hasUpdate====')
          updateManager.onUpdateReady(function () {
            wx.showModal({
              title: version.title[lang],
              content: version.content[lang],
              success: function (res) {
                console.log('success====', res)
                // res: {errMsg: "showModal: ok", cancel: false, confirm: true}
                if (res.confirm) {
                  // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
                  updateManager.applyUpdate()
                }
              }
            })
          })
          updateManager.onUpdateFailed(function () {
            // 新的版本下载失败
            wx.showModal({
              title: version.failtitle[lang],
              content: version.failcontent[lang]
            })
          })
        }
      })
    }
  },

  ///语言包
  langpagcke: {
    version: {
      title: ["更新提示", "MiniApp Update Tips"],
      content: ["新版本已经准备好，是否重启应用？", "New Version Has Been Ready， Restart Or Not？"],
      failtitle: ["已经有新版本了", "Has New Version"],
      failcontent: ["新版本已经上线~，请您删除当前小程序，重新搜索打开", "New version has released,please detele this version ,and reopen the miniapp"],

    },
    apptitle: ["君品习酒中国精英公开赛", ""],
    langtips: ["EN", "中文"],
    errormsg: ["网络连接失败，请检查网络", "Net Connecttion Error!Please Check!"],
    menulang: [
      ["成绩", "SCORES"],
      ["媒体", "MEDIA"],
      ["首页", "HOME"],
      ["球场", "COURSE"],
      ["更多", "MORE"]
    ],
    index: {
      starplayer: ["明星球员", "STAR Players"],
      moreplayer: ["更多球员", "MORE PLayers"],
      quaEnter: ["专区-进入", "Q-School-Enter"],
      lastestNews: ["最近新闻", "LASTEST News"],
      MoreNews: ["更多新闻", "MORE News"],
      proamEnter: ["信息收集", "Information Registration"],
      proam: ["职业业余配对赛", "PRO-AM"],
    },
    leader: {
      sharetitle: ["的成绩列表", "SCORES"],
    },
    video: {
      highlight: ["精彩图集", "HIGH Lights"],
      Changehl: ["切换图集", "CHANGE"],
    },
    course: {
      introduce: ["球道攻略", "HOLE Introduce"]
    },
    qua: {
      title: ["资格赛专区", "Qualify School"]
    },
    proam: {
      title: ["配对赛信息填写收集", "PRO-AM Information Collection"],
      titletips: ["请您填写配对赛嘉宾登记表信息，谢谢！", "Please registe the information of guest for the PRO-AM! Thanks!"],
      coursetips: ["球场", "Course"],
      guestnametips: ["姓名", "Name"],
      guestsextips: ["性别", "Sex"],
      guestteltips: ["联系电话", "Telephone"],
      guesttshirttips: ["T恤尺码", "T-shirt Size"],
      guestsexcodes: [
        ["女", "男"],
        ["Female", "Male"]
      ],
      guestsecodestips: ["请选择性别", "Please select Male/ Female"],
      guesttshirtselcttips: ["请选择尺码", "Please select Size"],
      sizecode: ["S", "M", "L", "XL", "XXL"],
      guestcommitinfo: ["感谢您填写配对赛嘉宾信息登记表", "Thanks for your filling!"],
      guestcommit: ["提交信息", "Commit"],
      scheduletips: ["日程安排", "Schedule"],
      errortipsname: ["请填写姓名", "please fill the name"],
      errortipstel: ["请联系方式", "please fill the telephoneno"],
      errortipssize: ["请选择T恤尺码", "please select the T-shirt Size"],
      errortipssexcode: ["请选择性别", "please select Male or Female"],
      succusstips: ["信息提交成功", "Committed Successfully!"],
      succusstipsbackhome: ["返回主页", "Go To Home"],
    },
    more: {
      name: ["姓名", "NAME"],
      tourinfo: ["赛事信息", "TOURNAMENT Info"],
      FAVplayers: ["关注球员", "FAV PLayers"],
      Schedule: ["日程表", "TOURNAMENT Schedule"],
      mytickets: ["我的入场券", "MY Tickets"],
      teetime: ["分组表", "TOURNAMENT Drawsheet"],
      Setting: ["个人设置", "SETTING"],
      Player: ["我是球员", "I'm Player"],
    },
    group: {
      drawsheet: ["分组表", "DRAW"],
      tourinfo: ["赛事信息", "INFO"],
      Hotelinfo: ["酒店信息", "HOTEL"],
      Schedule: ["日程表", "SCHEDULE"],
      Busshuttle: ["班车信息", "SHUTTLE"],
      Empty: ["暂无信息", "NO INFO"]
    },
    login: {
      loginbt: ["微信登录", "Wechat Login"],
      logintips: ["请使用微信登录", "Please Login by Wechat"],
    },
    player: {
      playerlogintips: ["系统提示", "TIPS"],
      playerlogincontents: ["系统检测到您未登录，请先登录再使用关注球员功能", "Please use the function after login."],
      playerloginconfirm: ["前往登录", "Login"],
      playerlogincancel: ["取消", "cancel"],
    },
    news: {
      title: ["新闻中心", "Media Center"],
      endtips: ["到底了~", "No More NEWS~"],
    },
    matchlive: {
      live: ["直播中", "LIVE"],
      pause: ["已暂停", "PAUSED"],
    }

  },

  getIndexpics: function (fnSuccse) {
    var data;
    var that = this;
    data = {
      type_id: "pic",
      index: 1,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    }

    var url = that.globalData.interfacegemedia;
    console.log("getmediaindex");
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }
    );
  },


  
  getMatchlives: function (fnSuccse) {
    var data;
    var that = this;
    data = {
      type_id: "pic",
      index: 1,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    }

    var url = that.globalData.interfacegematchlives;
    console.log("interfacegematchlives");
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }
    );
  },



  getmedia: function (index, matchid, type, fnSuccse, offset, pageno, fnfinal) {
    var data;
    var that = this;
    if (index) {
      data = {
        index:index,
        type_id: type,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      }
    } else {
      data = {
        match_id: matchid,
        type_id: type,
        openid: that.globalData.userInfo.openid,
        offset: offset,
        pageno: pageno,
        lang: that.getlangVar()
      };
    }
    var url = that.globalData.interfacegemedia;
    console.log("getmedia");
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        console.log("media-error");
        console.log(res);
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinal
    );
  },


  ///微信登陆
  wxlogin: function (app, flogin, shareuserID, userInfo) {
    console.log("wx.getStorageSync('userInfo')");
    console.log(wx.getStorageSync('userInfo'));
    if (wx.getStorageSync("isautologin") && wx.getStorageSync('userInfo') && wx.getStorageSync('userInfo').openid) {
      app.globalData.userInfo = wx.getStorageSync('userInfo');
      userInfo = app.globalData.userInfo;
      /*
      wx.login({
        fail: function (res) {
          wx.showToast({
            title: res.res,
          })
        },
        success: function (res) {
          console.log(res);
          app.globalData.userInfo.code = res.code;
          var code =  app.globalData.userInfo.code;
          wx.getUserProfile({
            desc: '用于完善会员资料',
            success: res => {
              console.log(ures)
              app.globalData.userInfo = ures.userInfo;
              app.globalData.userInfo.iv = ures.iv;
              app.globalData.userInfo.encryptedData = ures.encryptedData;
              app.globalData.userInfo.code = code;
              
              that.wxgetuserinfo(flogin,  app.globalData.userInfo.code, app.globalData.userInfo);
            },
            fail:res=>{
              console.log(res);
            }
          })
        }
      })
      return;*/
      //this.getuserinfofromserver(flogin, function () {}, this, userInfo.code, userInfo);
    } 
      var that = this;
      /*
      console.log(userInfo);
      wx.login({
        fail: function (res) {
          wx.showToast({
            title: res.res,
          })
        },
        success: function (res) {
          console.log(res);

          that.wxgetuserinfo(flogin, res.code, userInfo);
        }
      })*/
      that.wxgetuserinfo(flogin, (userInfo)?userInfo.code:'', userInfo);
    
  },
  //获取微信用户信息
  wxgetuserinfo(flogin, code, userInfo, fnfinal) {
   
    this.getuserinfofromserver(flogin, fnfinal, this, code, userInfo);
    return;
    /*
    var that = this;
    wx.getSetting({
      success: res => {
        if (!res.authSetting['scope.userInfo']) {

          wx.authorize({
            scope: 'scope.userInfo',
            success() {
              // 用户已经同意小程序获取信息，后续调用 wx.getuserinfo 接口不会弹窗询问
              that.getuserinfo(flogin, fnfinal, that, code);
            },
            fail(rescode) {
              console.log(rescode);
              wx.showModal({
                title: '请打开允许使用用户信息的权限',
                success: function () {
                  wx.openSetting({
                    complete: (res) => {
                      console.log(res);
                    },
                  })
                }
              });
              if (fnfinal) {
                fnfinal();
              }
            },
          })
        }
        if (res.authSetting['scope.userInfo']) {
          // 已经授权，可以直接调用 getUserInfo 获取头像昵称，不会弹框
          that.getuserinfofromserver(flogin, fnfinal, that, code);
        } else {

        }
      }
    })
    */
  },

  getuserinfofromserver(flogin, fnfinal, that, code, userInfo) {
    
    var url = that.globalData.interfacelogin;
    var userinfo = (userInfo) ? userInfo : that.globalData.userInfo;
    var param = {
      code: code,
      encryptedData: userinfo.encryptedData,
      iv: userinfo.iv,
    }

    console.log(url);
    console.log(param);
    console.log(that);
    that.requestdata(url, param, function (resdata) {
        console.log('getuserinfofromserver');
        console.log(resdata);
        if (resdata.data.errorcode.code == "ok") {

          that.globalData.userInfo = resdata.data.data;
          that.globalData.userInfo.code = code;
          that.globalData.userInfo.encryptedData = userInfo.encryptedData;
          that.globalData.userInfo.iv = userInfo.iv;

          wx.setStorageSync('userInfo', that.globalData.userInfo);
          // that.globalData.userInfo.usercat = that.globalData.constusercat.teacher;
          if (flogin) {

            flogin();
          } else {
            console.log("onShow");
            var pages = getCurrentPages();
            var currPage = pages[pages.length - 1]; //当前页面

            if (currPage != undefined) {
              console.log(currPage);
              currPage.onShow(); //刷新当前页面
            }
          }
        }
      }, function (resdata) {},
      fnfinal);
  },

  GetPhoneNumber:function(code,fnSuccse, fnfinally){
    var data = {code:code};
    var that = this;
    
    var url = that.globalData.interfaceGetPhoneNumber;
    console.log("GetPhoneNumber");
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          console.log("GetPhoneNumber");
          console.log(res);
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinally);
  },

  getSponsosr(index, fnSuccuce) {

  },

  getuserinfo(flogin, fnfinal, that, code) {
    console.log(that);

    /*wx.showModal({
      title: '温馨提示',
      content: '亲，授权微信登录后才能正常使用小程序',
      success(res) {
        console.log(0)
        console.log(res)
        //如果用户点击了确定按钮
        if (res.confirm) {
          wx.getUserProfile({
            desc: '获取你的昵称、头像、地区及性别',
            success: res => {
              console.log(res);
              console.log(1);
              console.log(res);
              // 可以将 res 发送给后台解码出 unionId
      
              var url = that.globalData.interfacelogin;
      
              var param = {
                code: code,
                encryptedData: res.encryptedData,
                iv: res.iv,
              }
      
              console.log(url);
              console.log(param);
              
              that.requestdata(url, param, function (resdata) {
                if (resdata.data.errorcode.code == "ok") {
      
                  that.globalData.userInfo = resdata.data.data;
      
                  wx.setStorageSync('userInfo', that.globalData.userInfo);
                  // that.globalData.userInfo.usercat = that.globalData.constusercat.teacher;
                  if (flogin) {
      
                    flogin();
                  } else {
                    console.log("onShow");
                    var pages = getCurrentPages();
                    var currPage = pages[pages.length - 1]; //当前页面
      
                    if (currPage != undefined) {
                      console.log(currPage);
                      currPage.onShow(); //刷新当前页面
                    }
                  }
                }
              }, function (resdata) { },
                fnfinal);
            },
            fail: res => {
              console.log(2);
              console.log(res)
              //拒绝授权
              wx.showToast({
                title: '您拒绝了请求,不能正常使用小程序',
                icon: 'error',
                duration: 2000
              });
              return;
            }
          });
        } else if (res.cancel) {
          //如果用户点击了取消按钮
          console.log(3);
          wx.showToast({
            title: '您拒绝了请求,不能正常使用小程序',
            icon: 'error',
            duration: 2000
          });
          return;
        }
      }
    });*/

    wx.getUserProfile({
      desc: '获取你的昵称、头像、地区及性别',
      success: res => {
        console.log(res);
        console.log(1);
        console.log(res);
        // 可以将 res 发送给后台解码出 unionId

        var url = that.globalData.interfacelogin;

        var param = {
          code: code,
          encryptedData: res.encryptedData,
          iv: res.iv,
        }

        console.log(url);
        console.log(param);

        that.requestdata(url, param, function (resdata) {
            if (resdata.data.errorcode.code == "ok") {

              that.globalData.userInfo = resdata.data.data;

              wx.setStorageSync('userInfo', that.globalData.userInfo);
              // that.globalData.userInfo.usercat = that.globalData.constusercat.teacher;
              if (flogin) {

                flogin();
              } else {
                console.log("onShow");
                var pages = getCurrentPages();
                var currPage = pages[pages.length - 1]; //当前页面

                if (currPage != undefined) {
                  console.log(currPage);
                  currPage.onShow(); //刷新当前页面
                }
              }
            }
          }, function (resdata) {},
          fnfinal);
      },
      fail: res => {
        console.log(2);
        console.log(res)
        //拒绝授权
        wx.showToast({
          title: '您拒绝了请求,不能正常使用小程序',
          icon: 'error',
          duration: 2000
        });
        return;
      }
    });



    wx.getUserProfile({
      fail: res => {
        console.log(res);
      },
      success: res => {

      }

    })
  },
  getmatchinforeg: function (year, type, fnSuccse, fnfinally) {
    var data;
    var that = this;
    if (type) {
      data = {
        status: 'R',
        class: 2,
        year: year,
        mt_area:type,
        type_id: "MEM",
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      }
    } else {
      data = {
        type_id: "MEM",
        year: year,
        status: 'R',
        class: 2,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      };
    }
    var url = that.globalData.interfacegetmatches;
    console.log("getmatchinprogress");
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          console.log("getmatches");
          console.log(res);
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinally);
  },

  getmatchinprepare: function (year, type, fnSuccse, fnfinally) {
    var data;
    var that = this;
    if (type) {
      data = {
        type_id: type,
        year: year,
        status: 'P',
        class: 2,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      }
    } else {
      data = {
        type_id: "MEM",
        year: year,
        status: 'P',
        class: 2,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      };
    }
    var url = that.globalData.interfacegetmatches;
    console.log("getmatchinprepare");
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          console.log("getmatchinprepare");
          console.log(res);
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinally);
  },

  getmatchinprogress: function (year, type, fnSuccse, fnfinally) {
    var data;
    var that = this;
    if (type) {
      data = {
        type_id: type,
        year: year,
        status: 'O',
        class: 2,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      }
    } else {
      data = {
        type_id: "MEM",
        year: year,
        status: 'O',
        class: 2,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      };
    }
    var url = that.globalData.interfacegetmatches;
    console.log("getmatchinprogress");
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          console.log("getmatches");
          console.log(res);
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinally);
  },


  getmytour:function(match_id,fnSuccse, fnfinal){
    var data = {
      player_id:this.globalData.userInfo.player_id,
    };
    if(match_id){
      data.mt_id = match_id;
    }
    var that = this;

     
    var url = that.globalData.interfacegetmytour;
    console.log("getmytour");
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          console.log("getmytour");
          console.log(res);
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinal);
  },

  getmatchlists: function (year, type, classtype,fnSuccse, fnfinal, area, mt_type,) {
    var data;
    var that = this;
    if (type) {
      data = {
        type_id: type,
        year: year,
        openid: that.globalData.userInfo.openid,
        mt_area:area?area:'',
        mt_type:mt_type?mt_type:'',
        lang: that.getlangVar()
      }
    } else if (classtype) {
      data = {
        type_id: "MEM",
        year: year,
        class: 1,
        status: "",
        mt_area:area?area:'',
        mt_type:mt_type?mt_type:'',
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      };
    } else {
      data = {
        type_id: "",
        year: year,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      };
    }
    var url = that.globalData.interfacegetmatches;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          console.log("getmatches");
          console.log(res);
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinal);
  },


  getleaders: function (fnSuccse, fnfinal) {
    var data;
    var that = this;
   
      data = {
       
      }
    
    console.log("getleaders-Params");
    console.log(data);


    var url = that.globalData.interfacegetgetleaders;
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          console.log(res);
          console.log("res");
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinal);
  },
  
  getmemebers: function (index, matchid, sex_id,pageno, type, fnSuccse, keywords, fnfinal) {
    var data;
    var that = this;
    if (index) {
      data = {
        type_id: "index", //"index",
        match_id: 0,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar(),
        pageno:pageno||'',
      }
    } else {
      data = {
        match_id: matchid,
        type_id: 'all',
        sex_id: sex_id,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar(),
        first_name: keywords,
         pageno:pageno||'',
      };
    }
    console.log("getmemebers-Params");
    console.log(data);


    var url = that.globalData.interfacegetmemebers;
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          console.log(res);
          console.log("res");
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinal);
  },

  getplayers: function (index, matchid, sex_id, type, fnSuccse, keywords, fnfinal) {
    var data;
    var that = this;
    if (index) {
      data = {
        type_id: "index", //"index",
        match_id: 0,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar()
      }
    } else {
      data = {
        match_id: matchid,
        type_id: type,
        sex_id: sex_id,
        openid: that.globalData.userInfo.openid,
        lang: that.getlangVar(),
        first_name: keywords,
      };
    }
    console.log("getplayers-Params");
    console.log(data);


    var url = that.globalData.interfacegetplayers;
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          console.log(res);
          console.log("res");
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinal);
  },

  getlangVar: function () {
    return (this.globalData.lang == 0) ? 'cn' : 'en';
  },


  getmatchmatchshuttelbus: function (matchid, fnSuccse, fnfail) {
    var that = this;
    var data = {
      match_id: matchid,
      type_id: 4,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };
    var url = that.globalData.interfacegetmatchmatchshuttlebus;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          if (fnfail) {
            fnfail(res);
          } else {
            wx.showToast({
              title: res.data.errorcode.message,
              icon: 'none'
            })
          }
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },

  getmatchmatchhotel: function (matchid, fnSuccse) {
    var that = this;
    var data = {
      match_id: matchid,
      type_id: 3,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };
    var url = that.globalData.interfacegetmatchmatchhotel;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },

  getmatchmatchschedule: function (matchid, fnSuccse) {
    var that = this;
    var data = {
      match_id: matchid,
      type_id: 2,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };
    var url = that.globalData.interfacegetmatchschedule;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },

  getmatchreglartion: function (matchid, fnSuccse) {
    var that = this;
    var data = {
      match_id: matchid,
      type_id: 1,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };
    var url = that.globalData.interfacegetmatchreglartion;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {

            console.log("interfacegetmatchreglartion");
            console.log(res.data.data);
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },

  getmatchleadersbyround: function (matchid, roundid, fnSuccse) {
    var that = this;
    var data = {
      match_id: matchid,
      round_id: roundid,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };
    var url = that.globalData.interfacegetmatchinfo;
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          console.log(data);
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },

  getmatchleaders: function (matchid, fnSuccse) {
    var that = this;
    var data = {
      match_id: matchid,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };

    var url = that.globalData.interfacegetmatchinfo;
    that.requestdata(url, data,
      function (res) {
        console.log(res);
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {

            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },


  getmatchdrawsheet: function (matchid, roundid, fnSuccse, fnfinal) {
    var that = this;
    var data = {
      match_id: matchid,
      round_id: (roundid) ? roundid : 0,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar(),

    };
    var url = that.globalData.interfacegetmatchDrawsheet;
    console.log(url);
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
            console.log(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnfinal);
  },

  playerfollow: function (player_id, type_id, fnSuccse) {
    var that = this;
    var data = {

      player_id: player_id,
      type_id: type_id, // (1男，0女)
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };
    var url = that.globalData.interfaceplayerfollow;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          if (fnfail) {
            fnfail(res);
          } else {
            wx.showToast({
              title: res.data.errorcode.message,
              icon: 'none'
            })
          }
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },

  comitproaminfo: function (matchid, TrueName, UserSex, UserMobile, UserSize, fnSuccse, fnfail) {

    var that = this;
    var data = {
      ClubID: 551,
      MatchID: matchid,
      TrueName: TrueName,
      UserSex: UserSex, // (1男，0女)
      UserMobile: UserMobile,
      UserSize: UserSize,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };
    var url = that.globalData.interfacegetRegisterproam;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          if (fnfail) {
            fnfail(res);
          } else {
            wx.showToast({
              title: res.data.errorcode.message,
              icon: 'none'
            })
          }
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },


  getcourse: function (matchid, courseid, fnSuccse) {
    var that = this;
    var data = {
      type_id: 0,
      match_id: matchid,
      course_id: courseid,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };
    var url = that.globalData.interfacegetcourseYards;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },

  
  
  //
   commitmatchregister(playermaytchinfo, fnSuccse, fnFinal){
    var that = this;
    var data = playermaytchinfo;
    var url = that.globalData.interfacegetcommitmatchregister;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
   },


   
   


   getgetticketsinfo(mt_id,rd_id,ticked_id,souce_id, fnSuccse, fnFinal) {
      var that = this;
      var data = {
        ticked_id: ticked_id,
        mt_id:mt_id,
        rd_id:rd_id,
        souce_id:souce_id,
        openid: that.globalData.userInfo.openid,
        
      };
      var url = that.globalData.interfacegetgetticketsinfo;
      that.requestdata(url, data,
        function (res) {
          if (res.data.errorcode.code == "ok") {
            if (fnSuccse) {
              fnSuccse(res);
            }
          } else {
            wx.showToast({
              title: res.data.errorcode.message,
              icon: 'none'
            })
          }
        },
        function (res) {
          wx.showToast({
            title: res.error,
            icon: 'none'
          })
        }, fnFinal);
    },

    commitickets(mt_id,rd_id,ticked_id,ticked_codeno,souse_id,fnSuccse, fnFinal) {
      var that = this;
      var data = {
        souse_id:souse_id,
        ticked_id: ticked_id,
        mt_id:mt_id,
        rd_id:rd_id,
        ticked_codeno:ticked_codeno,
        openid: that.globalData.userInfo.openid,
        
      };
      var url = that.globalData.interfacegetcommitickets;
      that.requestdata(url, data,
        function (res) {
          if (res.data.errorcode.code == "ok") {
            if (fnSuccse) {
              fnSuccse(res);
            }
          } else {
            wx.showToast({
              title: res.data.errorcode.message,
              icon: 'none'
            })
          }
        },
        function (res) {
          wx.showToast({
            title: res.error,
            icon: 'none'
          })
        }, fnFinal);
    },

    getmyticketlists(fnSuccse, fnFinal) {
      var that = this;
      var data = {
        
        openid: that.globalData.userInfo.openid,
        
      };
      var url = that.globalData.interfacegetmyticketlists;
      that.requestdata(url, data,
        function (res) {
          if (res.data.errorcode.code == "ok") {
            if (fnSuccse) {
              fnSuccse(res);
            }
          } else {
            wx.showToast({
              title: res.data.errorcode.message,
              icon: 'none'
            })
          }
        },
        function (res) {
          wx.showToast({
            title: res.error,
            icon: 'none'
          })
        }, fnFinal);
    },

    checktickets(mt_id,rd_id,ticked_id,ticked_codeno,fnSuccse, fnFinal) {
      var that = this;
      var data = {
        ticked_id: ticked_id,
        mt_id:mt_id,
        rd_id:rd_id,
        ticked_codeno:ticked_codeno,
        openid: that.globalData.userInfo.openid,
        
      };
      var url = that.globalData.interfacegetchecktickets;
      that.requestdata(url, data,
        function (res) {
          if (res.data.errorcode.code == "ok") {
            if (fnSuccse) {
              fnSuccse(res);
            }
          } else {
            wx.showToast({
              title: res.data.errorcode.message,
              icon: 'none'
            })
          }
        },
        function (res) {
          wx.showToast({
            title: res.error,
            icon: 'none'
          })
        }, fnFinal);
    },



  getmatchregisterinfo(reg_id, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      reg_id: reg_id,
      openid: that.globalData.userInfo.openid,
      
    };
    var url = that.globalData.interfacegetgetmatchregisterinfo;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },
  
  getteamInfo(tm_name,year, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      year:year,
      openid: that.globalData.userInfo.openid,
      tm_name: tm_name,
    };
    var url = that.globalData.interfacegetteamrinfo;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  getplayerInfo(playerid,year,score, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      year:year,
      openid: that.globalData.userInfo.openid,
      pl_id: playerid,
      score:score
    };
    var url = that.globalData.interfacegetplayerinfo;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  
  getteamscorecard(matchid, tm_id, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      match_id: matchid,
      openid: that.globalData.userInfo.openid,
      tm_id: tm_id,
    };
    var url = that.globalData.interfacegetteamscore;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  getplayerscorecard(matchid, playerid, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      match_id: matchid,
      openid: that.globalData.userInfo.openid,
      pl_id: playerid,
    };
    var url = that.globalData.interfacegetscorecard;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  getindexcourse: function (fnSuccse) {
    var that = this;
    var data = {
      type_id: 1,
      course_id: 0,
      openid: that.globalData.userInfo.openid,
      lang: that.getlangVar()
    };
    var url = that.globalData.interfacegetcourseYards;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      });
  },


  

  // 提交报名  
  user_sign: function (mt_id, fnSuccse, fnFinal) {
    var that = this;
    var data = {mt_id:mt_id};

    
    data.userID = this.globalData.userInfo.userID;
    data.userOpenid = this.globalData.userInfo.openid;
     
    
    var url = that.globalData.interfaceusersign;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  // 提交报名  
  commitregsiterinfo: function (mt_id, register_info, fnSuccse, fnFinal) {
    var that = this;
    var data = register_info;

    data.mt_id = mt_id;
    data.userID = this.globalData.userInfo.userID;
    data.userOpenid = this.globalData.userInfo.openid;

    var url = that.globalData.interfaceregistermatch;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },


  //获取所有的注册信息 
  getregsiterinfo: function (mt_id, fnSuccse, fnfail, fnFinal) {
    var that = this;
    var data = {
      mt_id: mt_id,
      userID: this.globalData.userInfo.userID,
      userOpenid: this.globalData.userInfo.openid,
    };
    var url = that.globalData.interfacegetuserregisterinfo;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          console.log("getregsiterinfo-fnfail");
          console.log(res);
          if (fnfail) {
            fnfail(res);
          } else {
            wx.showToast({
              title: res.data.errorcode.message,
              icon: 'none',
              duration: 5000,
            })
          }
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  //获取所有报名的比赛列表 interfacegetregsiterstatuslists status_id =1 是成功的 status_id=2是不通过的

  getregsiterstatuslists: function (playerID, status_id, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      playerID: playerID,
      status_id: status_id,
      userID: this.globalData.userInfo.userID,
      userOpenid: this.globalData.userInfo.openid,
    };
    var url = that.globalData.interfacegetregsiterstatuslists;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  //获取所有的报名的数量
  getregsiterstatus: function (playerID, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      playerID: playerID,
      userID: this.globalData.userInfo.userID,
      userOpenid: this.globalData.userInfo.openid,
    };
    var url = that.globalData.interfacegetregsiterstatus;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  getbasicplayerinfo: function (fnSuccse, fnFinal) {
    var that = this;
    var data = {
      userID: this.globalData.userInfo.userID,
      userOpenid: this.globalData.userInfo.openid,
    };
    var url = that.globalData.interfacegetuserinfo;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  accountlogin: function (user_name, user_pwd, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      user_name: user_name,
      user_pwd: user_pwd,
    };



    var url = that.globalData.interfaceaccountlogin;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  updatepassword: function (password, fnSuccse, fnFinal) {

    var that = this;
    var data = password;

    data.userID = this.globalData.userInfo.userID;
    data.userOpenid = this.globalData.userInfo.openid;

    var url = that.globalData.interfaceupdatepassword;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none'
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  //获取排名
  getranking1(group_id, offset,area, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      group_id: group_id,
      offset: offset,
      area:area,
    };
    var url = that.globalData.interfacegetranking;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },

   //获取排名
   getteamranking( year, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      year: year||'',
    };
    var url = that.globalData.interfacegetteamranking;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },


  //获取所有报名人 分页
  getrgelistsperson(act_id, offset, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      act_id: act_id,
      offset: offset,
    };
    var url = that.globalData.interfacegetrgelistsperson;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },

  //获取活动列表
  getactivitylists(offset, fnSuccse, fnFinal) {
    var that = this;
    var data = {};
    console.log("getactivitylists");
    console.log(offset);
    if (offset) {
      data.offset = offset;
    }

    var url = that.globalData.interfacegetactivity;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },


  //获取活动信息
  getactivityinfo(ac_id, shareuserID, channelID, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      ac_id: ac_id,
      shareuserID: shareuserID,
      channelID: channelID,
    };


    var url = that.globalData.interfaceactivityinfo;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },

  //提交活动注册报名
  commitactivityregister(params, fnSuccse, fnFinal) {
    var that = this;
    var data = params;


    var url = that.globalData.interfaceactivityresgit;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },
  //获取活动报名信息
  getactivityregisterinfo(ac_id, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      ac_id: ac_id,
    };
    var url = that.globalData.interfaceactivityregister;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },


  //获取二维码地址
  getQrcode(data, fnSuccse, fnFinal) {
    var that = this;
    var data = data;
    var url = that.globalData.interfacegetQrcode;
    that.requestdata(url, data,
      function (res) {

        if (fnSuccse) {
          fnSuccse(res.data.trim());
        }


      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },
  search: function (keyword, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      keyword: keyword,

    };
    var url = that.globalData.interfacesearch;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },

  getpastchampion(year, fnSuccse, fnFinal) {
    var that = this;
    var data = {
      year: year, //0位查询全部年份

    };
    var url = that.globalData.interfacegetgetpastchampion;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
        })
      }, fnFinal);

  },
  getranking(year, offset,area,pageno,fnSuccse, fnFinal) {
    var that = this;
    var data = {
      year: year, //0位查询全部年份
      offset: offset ,//0 位查询所有排名  top5时用5 
      area:area,
      pageno:pageno,
    };
    var url = that.globalData.interfacegetgetRanking;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
        })
      }, fnFinal);

  },

  basiccardnum: function (playerinfo, fnSuccse, fnFinal) {
    var that = this;
    var data = playerinfo;
    var url = that.globalData.interfacebasiccardnum;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },
  basicplayerinfo: function (playerinfo, fnSuccse, fnFinal) {
    var that = this;
    var data = playerinfo;
    var url = that.globalData.interfacebasicplayerinfo;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  
  getststaics:function(matchid,fnSuccse, fnFinal){
    var that = this;
    var data = {
      match_id:matchid,
    };
    var url = that.globalData.interfacegetststaics;
    that.requestdata(url, data,
      function (res) {
        console.log('getststaics',res);
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            duration: 5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none',
          duration: 3000,
        })
      }, fnFinal);
  },
 getscoreststaics:function(matchid,fnSuccse, fnFinal){
  var that = this;
  var data = {
    match_id:matchid,
  };
  var url = that.globalData.interfacegetscoreststaics;
  that.requestdata(url, data,
    function (res) {
      if (res.data.errorcode.code == "ok") {
        if (fnSuccse) {
          fnSuccse(res);
        }
      } else {
        wx.showToast({
          title: res.data.errorcode.message,
          duration: 5000,
        })
      }
    },
    function (res) {
      wx.showToast({
        title: res.error,
        icon: 'none',
        duration: 3000,
      })
    }, fnFinal);
},
getroundholeststaics:function(matchid,roundid,fnSuccse, fnFinal){
  var that = this;
  var data = {
    match_id:matchid,
    round_id:roundid,
  };
  var url = that.globalData.interfacegetroundholeststaics;
  that.requestdata(url, data,
    function (res) {
      if (res.data.errorcode.code == "ok") {
        if (fnSuccse) {
          fnSuccse(res);
        }
      } else {
        wx.showToast({
          title: res.data.errorcode.message,
          duration: 5000,
        })
      }
    },
    function (res) {
      wx.showToast({
        title: res.error,
        icon: 'none',
        duration: 3000,
      })
    }, fnFinal);
},

  checkislogin() {
    var userInfo = this.globalData.userInfo;
    var isautologin = wx.getStorageSync("isautologin");
    if (isautologin) {
      userInfo=wx.getStorageSync("userInfo");
    }
    console.log("checkislogin");
    console.log(userInfo);
    if (userInfo.openid || userInfo.userID) {
      console.log(userInfo.openid);
      return true;
    } else {
      return false;
    }
  },

  wxpay:function(register_id, fnSuccse, fnFinal){
    var that = this;
    var data ={
      UserOpenid:that.globalData.userInfo.openid,
      register_id:register_id,
    };
    var url = that.globalData.interfacewxpay;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },
  



 getpersonalmatcheslists:function(params, fnSuccse, fnFinal){
    var that = this;
    var data =params;
    var url = that.globalData.interfacegetpersonalmatcheslists;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },
  
   websocketsend:function(params, fnSuccse, fnFinal){
    var that = this;
    var data =params;
    var url = that.globalData.interfacewebsocketsend;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'warn',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal,true);
  },

  websocketrevice:function(params, fnSuccse, fnFinal){
    var that = this;
    var data =params;
    var url = that.globalData.interfacewebsocketrevice;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal,true);
  },

  
  getmatchawards:function(match_id,fnSuccse, fnFinal){
    var that = this;
    var data ={
      match_id:match_id
    };
    var url = that.globalData.interfacegetmatchawards;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  getintroduce:function(pageno,fnSuccse, fnFinal){
    var that = this;
    var data ={
      pageno:pageno||''
    };
    var url = that.globalData.interfacegetintroduce
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },



  /*  data  */ 


  //获取首页数据
  
  getindexdata:function(year, fnSuccse, fnFinal){
    var that = this;
    var data ={
    
      
      year:year?year:''
    };
    var url = that.globalData.interfacegetdata_index;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  //获取比赛数据统计
  getmatchesdata:function(area,year, fnSuccse, fnFinal){
    var that = this;
    var data ={
    
      area:area,
      year:year
    };
    var url = that.globalData.interfacegetdata_tour;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  
   //获取比赛数据统计
   getmatchesscoredata:function(area,year, fnSuccse, fnFinal){
    var that = this;
    var data ={
    
      area:area,
      year:year
    };
    var url = that.globalData.interfacegetscoredata_tour;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  getmatchesplayeredata:function(area,year, fnSuccse, fnFinal){
    var that = this;
    var data ={
    
      area:area,
      year:year
    };
    var url = that.globalData.interfacegetscoreplayer_tour;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  getplayerpic:function(user_id,player_id, fnSuccse, fnFinal){
    var that = this;
    var data ={
      user_id:user_id,
      player_id:player_id,
    };
    var url = that.globalData.interfacegetplayerpic;
    that.requestdata(url, data,
      function (res) {
        if (res.data.errorcode.code == "ok") {
          if (fnSuccse) {
            fnSuccse(res);
          }
        } else {
          wx.showToast({
            title: res.data.errorcode.message,
            icon: 'none',
            duration:5000,
          })
        }
      },
      function (res) {
        wx.showToast({
          title: res.error,
          icon: 'none'
        })
      }, fnFinal);
  },

  

  changeplayerpic:function(playerid,fnsuccuce,fnfinish){
    var that = this;
    wx.chooseImage({
      count:1,
      
      success (res) {
        const tempFilePaths = res.tempFilePaths;
        wx.showLoading({
          title: '头像正在上传中....',
        })
        wx.uploadFile({
          url: that.globalData.interfacefileupload, //仅为示例，非真实的接口地址
          filePath: tempFilePaths[0],
          dataType : 'json',
          name: 'imgfile',
          formData: {
            'playerid': playerid,
            'clubID': clubID,
            'miniappid': that.globalData.appId
          },
          success (res){
            console.log(res.data);
            var data="";
            if(res.data){
              data= JSON.parse(res.data.replace(/\ufeff/g, ""));
            }
            //do something
            if (data && data.errorcode == "ok") {
              if (fnsuccuce) {
                fnsuccuce(data);
              }
            } else {
              wx.showToast({
                title: data.message,
                icon:"info",
                duration: 5000,
              })
            }
          },
          fail:function(res){
          
          },
          complete:function(){
              wx.hideLoading();
              if(fnfinish){

              }
          }
        })
      }
    })
  },


  
  updateUserinfo:function(data,fnsuccuce,reject){
    var urldata =data;
    urldata.user_id = (this.globalData.userInfo.userID) ? this.globalData.userInfo.userID : 0;
    urldata.userID = (this.globalData.userInfo.userID) ? this.globalData.userInfo.userID : 0;
    urldata.playerID = (this.globalData.userInfo.player_id) ? this.globalData.userInfo.player_id : 0;
    urldata.openid = (this.globalData.userInfo.openid) ? this.globalData.userInfo.openid : 0;
     wx.request({
      url:this.globalData.interupdateUserinfo,
      data:urldata,
      method: 'POST',
      header: {
          "Content-Type": "application/x-www-form-urlencoded"
      },
      success(fileres) {
          console.log(fileres);
          if (fileres.data.errorcode.code == "ok") {
              // resolve(res.data);
              if (fileres.data) {  
                      //resolve(urls);
                      fnsuccuce(fileres.data.data);
              }

          } else {
              wx.showToast({
                  title: fileres.data.errorcode.message,
                  icon: 'error',
                  duration: 1200
              })

              return;
          }
      },
      fail(fileres) {
          console.log(fileres);
          wx.showToast({
              title: fileres.errMsg,
              icon: 'error'
          })
          reject(fileres);
      },
      complete() {
          wx.hideLoading();

      }
  })
  },


  logout: function () {
    this.globalData.userInfo.openid = '';
    this.globalData.userInfo.userID = '';
  },

  globalData: {
    userInfo: {
      openid: ''
    },
    selectmatch: null,
    code: '',
    refreshtime: refreshtime,
    navbarbackgroundtheme: '#30ad37',
    appId: wx.getAccountInfoSync().miniProgram.appId,
    imagebaseUrlTest: baseUrlTest + "image/",
    webuserurl: weburl + '/xijiuuser.html',
    payqrcode: weburl + "/pay.jpg",
    webvideouserurl: weburl + '/videouser.html',
    
    channelsfeedID:'sphgzBzN8ElDpDA',//视频号ID
    staticUrl:'https://scoringchina.oss-cn-beijing.aliyuncs.com/xijiuclassicopen/statics',
    imageUrl:'https://scoringchina.oss-cn-beijing.aliyuncs.com/xijiuclassicopen/images',
    imagelogourl: '',
    lang: 0, //0为中文  1位英文

    interfacelogin: baseUrl + "oauth/index",
    interfaceGetPhoneNumber:baseUrl + "oauth/getWxPhone",
    interfacegetmatchinfo: baseUrl + "Match/match_leaders/", //matchleaders.php
    //interfacegetmatchinfo: baseUrlTest + "matchleaders.php", 
    interfacegetplayerinfo: baseUrl + "Player/player_info/",
    interfacegetlogoes: baseUrl + "/Match/match_sponsor/", //Match/match_logo
    // interfacegetlogoes: baseUrl + "Match/match_logo/",
    //interfacegetindexcourseYards: baseUrlTest + "getcourseYards.php",
    interfacegetscorecard: baseUrl + "Player/player_score/",
    //interfacegemedia: baseUrlTest + "getmedia.php",//Match/match_media/
    interfacegemedia: baseUrl + "Match/match_media/",
    interfacegematchlives:baseUrl + "Match/match_photolive/",
    interfacegetplayers: baseUrl + "Player/match_player/", //getplayers.php
    //interfacegetcourseYards: baseUrlTest + "getcourseYards.php",Match/match_course/
    interfacegetcourseYards: baseUrl + "Match/match_course/",
    interfacegetmatchDrawsheet: baseUrl + "Match/match_group/", //matchDrawsheet.php
    //interfacegetmatches:baseUrlTest + "schedule.php",
    interfacegetRegisterproam: baseUrl + "Register/register/",
    interfacegetmatches: baseUrl + "Match/match_list/",
    interfacegetmatchreglartion: baseUrl + "Match/match_info/",
    interfacegetmatchschedule: baseUrl + "Match/match_info/",
    interfacegetmatchmatchhotel: baseUrl + "Match/match_info/",
    interfacegetmatchmatchshuttlebus: baseUrl + "Match/match_info/",
    interfaceplayerfollow: baseUrl + "Player/player_follow/",
    interfacebasicplayerinfo: baseUrl + 'user/bind_userinfo',
    interfacebasiccardnum: baseUrl + 'user/update_cardnum',
    interfacegetuserinfo: baseUrl + 'user/user_info',
    interfacegetuserregisterinfo: baseUrl + 'user/user_register_info',
    interfaceregistermatch: baseUrl + 'user/user_register',
    interfaceusersign: baseUrl + 'user/user_sign',
    interfaceupdatepassword: baseUrl + 'user/update_password',
    interfacegetregsiterstatus: baseUrl + 'user/register_status',
    interfacegetregsiterstatuslists: baseUrl + 'user/register_match_list',
    interfaceaccountlogin: baseUrl + 'user/user_login',
    interfacegetranking: baseUrl + 'user/rank_lists',
    interfacesearch: baseUrl + 'user/search_lists/ ',
    interfacegetactivity: baseUrl + 'active/active_list/',
    interfaceactivityinfo: baseUrl + 'active/active_info/',
    interfaceactivityregister: baseUrl + 'active/active_register',
    interfaceactivityresgit: baseUrl + 'active/submit_active_register',
    interfacegetQrcode: baseUrl + "qrcode/getQrcode.php",
    interfacegetrgelistsperson: baseUrl + "active/active_register_list/",
    interfacegetgetRanking: baseUrl + "ranking/all_ranking/",
    interfacegetgetpastchampion: baseUrl + "Match/match_champion/",
    interfacewxpay:baseUrl+'WeixinPay/pay',
    interfacefileupload:fileUrl+'fileupload.php',
    interfacegetplayerpic:baseUrl+ "Player/player_pic/",
    interfacegetteamscore:baseUrl+ "Player/team_score/",
    interfacegetmemebers:baseUrl + 'Member/getmember_lists',
    interfacegetgetleaders:baseUrl + 'Member/getleaders',
    interfacegetintroduce:baseUrl + 'Member/getintroducelists',
    interfacegetmatchawards:baseUrl + 'Match/match_awards',
    interfacegetteamranking:baseUrl +'ranking/all_team_ranking/',
    interfacegetteamrinfo:baseUrl +'Player/team_info/',
    interfacegetmytour:baseUrl + 'Match/mytour/',
    interfacegetroundholeststaics:baseUrl+'match/match_hole_statiscs',
    interfacegetscoreststaics:baseUrl+'match/match_score_statiscs',
    interfacegetststaics:baseUrl+'match/match_statiscs',

    interfacegetgetmatchregisterinfo:baseUrl+'user/getmatchregisterinfo',
    interfacegetcommitmatchregister:baseUrl+'user/commitmatchregister',
    interfacegetgetticketsinfo:baseUrl+'user/getticketsinfo',
    interfacegetchecktickets:baseUrl+'user/checktickets',
    interfacegetcommitickets:baseUrl+'user/committickets',
    interfacegetmyticketlists:baseUrl+'user/getmyticketlists',

    interfacegetpersonalmatcheslists:baseUrl+ "PersonalMatches/lists/",
    interfacewebsocketsend:baseUrl+ "web/send/",
    interfacewebsocketrevice:baseUrl+ "web/revice/",
    getOssInfo:baseUrl + 'FileUpload/getAliOssfile',
    interupdateUserinfo:baseUrl + 'user/updateUserinfo',
    interfaceuploadimage:baseUrl + 'FileUpload/savefiles',
    host:baseUrl,


    //data
    interfacegetdata_index:baseUrl+ "Data/index_data/",
    interfacegetdata_tour:baseUrl+ "Data/mid_top_match/",
    interfacegetscoreplayer_tour:baseUrl+ "Data/player_max_data/",
    interfacegetscoredata_tour:baseUrl+ "Data/scores_max_data/",
  }
})